# 1、创建环境
from pyspark.context import SparkContext

sc = SparkContext(master='local', appName='demo2_map')

# 2、读取数据
students_rdd = sc.textFile("../../data/students.txt")

sample_rdd = students_rdd.sample(withReplacement=True, fraction=0.1)

sample_rdd.foreach(print)